import Vue from "vue";
import VueRouter from "vue-router";
import Index from "@/components/Index.vue";
import Home from "@/components/home/index.vue";
import tradeAccount from "@/components/trade/tradeAccount.vue";
import tradeProducts from "@/components/trade/tradeProducts.vue";
import dataCenter from "@/components/tool/dataCenter.vue";
import learnCenter from "@/components/tool/learnCenter.vue";
import tradTool from "@/components/tool/tradTool.vue";
import Partners from "@/components/partners/index.vue";
import RI from "@/components/about/RI.vue";
import FAQ from "@/components/about/FAQ.vue";
import FreeAccount from "@/components/freeAccount/index.vue";
import Login from "@/components/login/index.vue";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    name: "Home",
    component: Home
  },
  {
    path: "/index",
    name: "Index",
    component: Index
  },
  {
    path: "/tradeAccount",
    name: "tradeAccount",
    component: tradeAccount
  },
  {
    path: "/tradeProducts",
    name: "tradeProducts",
    component: tradeProducts
  },
  {
    path: "/dataCenter",
    name: "dataCenter",
    component: dataCenter
  },
  {
    path: "/learnCenter",
    name: "learnCenter",
    component: learnCenter
  },
  {
    path: "/tradTool",
    name: "tradTool",
    component: tradTool
  },
  {
    path: "/partners",
    name: "Partners",
    component: Partners
  },
  {
    path: "/FAQ",
    name: "FAQ",
    component: FAQ
  },
  {
    path: "/RI",
    name: "RI",
    component: RI
  },
  {
    path: "/freeAccount",
    name: "FreeAccount",
    component: FreeAccount
  },
  {
    path: "/login",
    name: "Login",
    component: Login
  }
];

const router = new VueRouter({
  routes
});
const originalPush = VueRouter.prototype.push;
VueRouter.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err);
};

export default router;
